package com.yimi.appstore.anim;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.animation.Interpolator;

/** 
 * 类说明：   
 * @author  Terry Lu
 * @date    2012-2-3
 * @version 1.0
 */
public class ParabolaBounceInterpolator implements Interpolator {
	public ParabolaBounceInterpolator() {
	}

	@SuppressWarnings({"UnusedDeclaration"})
	public ParabolaBounceInterpolator(Context context, AttributeSet attrs) {
	}

	private static float bounce(float t) {
		return t * t * 8.0f;
	}

	@Override
	public float getInterpolation(float input) {
		// TODO Auto-generated method stub
		input *= 1.1226f;
		
		if (input < 0.3535f) {
			return bounce(input);
		}
		else {
			return bounce(input - 0.54719f) + 0.7f;
		}
	}

}
